<style type="text/css">
.order_admin_menu {
	border: 1px solid #ddd;
	width: 40px;
	height: 15px;
	line-height: 15px;
	text-align: center;	
}
.save_img {
	width: 13px;
	height: 13px;
	border: none;
}
</style>

<!-- js validate form  -->
<script type="text/javascript">
function submitform()
{
  document.myform.submit();
}

</script>

		<div class="content_head">
			<?php echo $title; ?>
		</div>	
		<div class="content_ct">
			<div class="content_ct_search">
				<table class="content_ct_search_tbl"  width="100%">
					<form method="POST" action="<?php echo base_url() ?>back_end/admin_menu/search">    
					<tr>
						<td width="10%">
							<span>Tên danh mục menu:</span>
						</td>
						<td width="10%">
							<input  class="content_ct_search_tbltxt" name="nameSearch" value="<?php if(isset($_SESSION['like_admin_menu'])){ echo $_SESSION['like_admin_menu']['name']; } ?>" type="text" />
						</td>
						<td width="40%"></td>
						<td width="40%"></td>
					</tr>
					
					<tr>
						<td></td>
						<td>
							<input id="input_checkbox_2" style="cursor:pointer;" type="submit" name="formSearch" value="Tìm kiếm" />
							<input style="cursor:pointer;" type="reset" value="Reset" />
						</td>
						<td></td>
						<td></td>
					</tr>
					</form>
				</table>		
			</div>
			<!-- end content_ct_search -->
			
			<div class="content_ct_show">
				<div class="content_ct_show_abs">
					<?php echo $this->session->flashdata('msview'); ?>
				</div>
				<div class="content_ct_show_paging">
					<span style="color: #888;">Tổng số:</span>
					<span style="color: #444;">(<?php echo $this->pagination->total_rows; ?>)</span>
					<?php echo $this->pagination->create_links(); ?>
				</div>
				
				<form name="myform" method="POST" action="<?php echo base_url()?>back_end/admin_menu/order" >
				<div class="content_ct_show_head">
					<a class="add_new" href="<?php echo base_url()?>back_end/admin_menu/add">Thêm mới</a>
					<span style="padding-left: 5px; color: #FF9933;" class="count_check"></span>
				</div>
				
				<div class="content_ct_show_ct">
					<table class="content_ct_show_ct_tbl" width="100%">   
						<tr class="content_ct_show_ct_tbl_top">
							<td width="5%">
								<input class="input_checkall" type="checkbox" />
							</td>
							<td width="5%">
		                    	<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/id/<?php echo $sort; ?>">ID</a>
							</td>
							<td width="20%">
								<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/name/<?php echo $sort; ?>">Name</a>
							</td>
							<td width="20%">
								<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/level/<?php echo $sort; ?>">Level</a>
							</td>
							<td width="20%">
								<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/controller/<?php echo $sort; ?>">Controlor</a>
							</td>
							<td width="5%">
								<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/order/<?php echo $sort; ?>">
									Order
								</a>
								<a style="cursor: pointer;" href="javascript: submitform()">
									<img class="save_img" title="Nhấn click để thay đổi thứ tự sắp xếp" src="<?php echo base_url(); ?>images/back_end/save.png" />
								</a>	
							</td>
							<td width="15%">
								<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/link/<?php echo $sort; ?>">Link</a>
							</td>
							<td width="5%">
								<a class="link_change" href="<?php echo base_url() ?>back_end/admin_menu/sort/status/<?php echo $sort; ?>">Status</a>
							</td>
							<td width="5%">
								<span>Action</span>
							</td>
						</tr>
						
						<?php
		                	$count = 1; 
		                	if (count($admin_menu_value) > 0) {
		                		foreach ($admin_menu_value as $value) {
		                		$count += 1;	 
		                ?> 
						<tr class="<?php if ($count%2) { echo 'content_ct_show_ct_tbl_bt_1'; } else { echo 'content_ct_show_ct_tbl_bt_2'; }  ?>">
							<td>
								<input class="input_checkbox" type="checkbox"  value="<?php echo $value['id']; ?>" name="value_id[]"/>
							</td>
							<td>
								<span><?php echo $value['id']; ?></span>
							</td>
							<td>
								<span><?php echo $value['name']; ?></span>
							</td>
							<td>
								<span><?php echo $value['level']; ?></span>
							</td>
							<td>
								<span><?php echo $value['controller']; ?></span>
							</td>
							<td>
								<input class="order_admin_menu" value="<?php echo $value['order']; ?>" name="order_admin_menu[<?php echo $value['id']; ?>]" type="text" />
							</td>
							<td>
								<span><?php echo $value['link']; ?></span>
							</td>
							<td>
								<?php if($value['status'] == 1) { ?>
		                    		<a class="tag_action" href="<?php echo base_url()?>back_end/admins/active/<?php echo $table.'-'.$value['id'].'-'.'0'.'-'.$table; ?>"><img src="<?php echo base_url()?>images/back_end/icon/check2.png" title="Trạng thái" alt="icon check" /></a>
		                    	<?php } else { ?>
		                 			<a class="tag_action" href="<?php echo base_url()?>back_end/admins/active/<?php echo $table.'-'.$value['id'].'-'.'1'.'-'.$table; ?>"><img src="<?php echo base_url()?>images/back_end/icon/check.png" title="Trạng thái" alt="icon check" /></a>
		                    	<?php }?>
							</td>
							<td>
								<a href="<?php echo base_url()?>back_end/admin_menu/edit/<?php  echo $value['id']; ?>">Sửa</a>
								<span>|</span>
								<a href="<?php echo base_url()?>back_end/admin_menu/delete/<?php  echo $value['id']; ?>">Xóa</a>
							</td>
						</tr>
						<?php }
						 	} else {
						?>
						<tr>
							<td colspan="6"><i style="color: #000;">Không có kết quả nào được tìm thấy</i></td>
						</tr> 
						 <?php
						 	} 
						 ?>
						 
					</table>
				</div>
				
				<div class="content_ct_show_paging">
					<?php echo $this->pagination->create_links(); ?>
				</div>		
				</form>
				
			</div>
			<!-- end content_ct_show -->
		</div>	